home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex / base / ltnews.cls < prev    next >
Text File  |  1994-12-17  |  14KB  |  471 lines

  1. % \iffalse meta-comment
  2. %
  3. % Copyright 1994 the LaTeX3 project and the individual authors.
  4. % All rights reserved. For further copyright information see the file
  5. % legal.txt, and any other copyright indicated in this file.
  6. % This file is part of the LaTeX2e system.
  7. % ----------------------------------------
  8. %  This system is distributed in the hope that it will be useful,
  9. %  but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. %  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. % IMPORTANT NOTICE:
  12. % For error reports in case of UNCHANGED versions see bugs.txt.
  13. % Please do not request updates from us directly.  Distribution is
  14. % done through Mail-Servers and TeX organizations.
  15. % You are not allowed to change this file.
  16. % You are allowed to distribute this file under the condition that
  17. % it is distributed together with all files mentioned in manifest.txt.
  18. % If you receive only some of these files from someone, complain!
  19. % You are NOT ALLOWED to distribute this file alone.  You are NOT
  20. % ALLOWED to take money for the distribution or use of either this
  21. % file or a changed version, except for a nominal charge for copying
  22. % etc.
  23. % \fi
  24. % Filename: ltnews.cls
  25. % Author: Alan Jeffrey
  26. % Version: 0.07
  27.  
  28. % This is the LaTeX2e document class for the `LaTeX News' information 
  29. % sheet which comes with every LaTeX release.  It may be useful for 
  30. % newsletters, or as an example of how simple newsletters can be set with 
  31. % LaTeX.  The changes log is at the end of the file.
  32.  
  33. % Copyright 1994 Alan Jeffrey and the LaTeX3 project.  All rights reserved.
  34.  
  35. % This is a LaTeX2e document class.
  36.  
  37. \NeedsTeXFormat{LaTeX2e}
  38.  
  39. \ProvidesClass{ltnews}[1994/11/29 Standard LaTeX class]
  40.  
  41. % The configuration file, used for passing options.
  42.  
  43. \InputIfFileExists{ltnews.cfg}{%
  44.    \ClassInfo{ltnews}{Using local configuration file}%
  45. }{%
  46.    \ClassInfo{ltnews}{No local configuration file}%
  47. }
  48.  
  49. % The lw35fonts option uses the fonts:
  50. %
  51. %    Adobe Palatino          (main text)
  52. %    Adobe Helvetica Bold    (headings)
  53. %    Courier                 (program listings)
  54. %    Mathptm math italic     (2e logo)
  55. %    Mathptm symbol font     (AMS logo)
  56. %
  57. % The type1fonts option uses the fonts:
  58. %    Adobe Utopia            (main text)
  59. %    URW Grotesk-T Bold      (headings)
  60. %    Lucida Sans typewriter  (program listings)
  61. %    Mathptm math italic     (2e logo)
  62. %    Mathptm symbol font     (AMS logo)
  63.  
  64. % The Adobe Palatino fonts:
  65.  
  66. \DeclareFontFamily{OT1}{ppl}{}
  67. \DeclareFontShape{OT1}{ppl}{m}{n}{<-> pplr7t}{}
  68. \DeclareFontShape{OT1}{ppl}{m}{sc}{<-> pplrc7t}{}
  69. \DeclareFontShape{OT1}{ppl}{m}{it}{<-> pplri7t}{}
  70.  
  71. % The Adobe Helvetica fonts:
  72.  
  73. \DeclareFontFamily{OT1}{phv}{}
  74. \DeclareFontShape{OT1}{phv}{b}{n}{<-> phvb7t}{}
  75.  
  76. % The Adobe Courier fonts:
  77.  
  78. \DeclareFontFamily{OT1}{pcr}{\hyphenchar\font=-1}
  79. \DeclareFontShape{OT1}{pcr}{m}{n}{<-> pcrr7t}{}
  80.  
  81. % The Utopia fonts:
  82.  
  83. \DeclareFontFamily{OT1}{put}{}
  84. \DeclareFontShape{OT1}{put}{m}{n}{<-> putr7t}{}
  85. \DeclareFontShape{OT1}{put}{m}{sc}{<-> putrc7t}{}
  86. \DeclareFontShape{OT1}{put}{m}{it}{<-> putri7t}{}
  87.  
  88. % The URW Grotesk fonts:
  89.  
  90. \DeclareFontFamily{OT1}{ugq}{}
  91. \DeclareFontShape{OT1}{ugq}{b}{n}{<-> ugqb7t}{}
  92.  
  93. % The Lucida Sans Typewriter fonts:
  94.  
  95. \DeclareFontFamily{OT1}{hlct}{\hyphenchar\font=-1}
  96. \DeclareFontShape{OT1}{hlct}{m}{n}{<-> hlct7t}{}
  97.  
  98. % The mathptm math italic:
  99.  
  100. \DeclareFontFamily{OML}{ptmcm}{\skewchar\font=127}
  101. \DeclareFontShape{OML}{ptmcm}{m}{it}{<-> zptmcmrm}{}
  102.  
  103. % The mathptm symbol font:
  104.  
  105. \DeclareFontFamily{OMS}{pzccm}{}
  106. \DeclareFontShape{OMS}{pzccm}{m}{n}{<-> zpzccmry}{}
  107.  
  108. % The TeX logo for use with Palatino.
  109.  
  110. \def\pplTeX{T\kern-.15em\lower.4ex\hbox{E}\kern-.1emX\@}
  111.  
  112. % The LaTeX logo for use with Palatino.
  113.  
  114. \DeclareRobustCommand{\pplLaTeX}{L\kern-.3em
  115.         {\setbox0\hbox{T}%
  116.          \vbox to\ht0{\hbox{%
  117.                             \csname S@\f@size\endcsname
  118.                             \fontsize\sf@size\z@
  119.                             \math@fontsfalse\selectfont
  120.                             A}%
  121.                       \vss}%
  122.         }%
  123.         \kern-.07em
  124.         \TeX}
  125.  
  126. % The TeX logo for use with Utopia.
  127.  
  128. \def\putTeX{T\kern-.1667em\lower.4ex\hbox{E}\kern-.075emX\@}
  129.  
  130. % The LaTeX logo for use with Utopia.
  131.  
  132. \DeclareRobustCommand{\putLaTeX}{L\kern-.2em
  133.         {\setbox0\hbox{T}%
  134.          \vbox to\ht0{\hbox{%
  135.                             \csname S@\f@size\endcsname
  136.                             \fontsize\sf@size\z@
  137.                             \math@fontsfalse\selectfont
  138.                             A}%
  139.                       \vss}%
  140.         }%
  141.         \kern-.05em
  142.         \TeX}
  143.  
  144. % The TeX logo for use with Helvetica.
  145.  
  146. \def\phvTeX{T\kern-.1em\lower.4ex\hbox{E}\kern-.05emX\@}
  147.  
  148. % The LaTeX logo for use with Helvetica.
  149.  
  150. \DeclareRobustCommand{\phvLaTeX}{L\kern-.3em
  151.         {\calculate@math@sizes
  152.          \setbox0\hbox{T}%
  153.          \vbox to\ht0{\hbox{%
  154.                             \csname S@\f@size\endcsname
  155.                             \fontsize\sf@size\z@
  156.                             \math@fontsfalse\selectfont
  157.                             A}%
  158.                       \vss}%
  159.         }%
  160.         \kern-.05em
  161.         \TeX}
  162.  
  163. % The TeX logo for use with Grotesk.
  164.  
  165. \def\ugqTeX{T\kern-.1em\lower.4ex\hbox{E}\kern-.05emX\@}
  166.  
  167. % The LaTeX logo for use with Grotesk.
  168.  
  169. \DeclareRobustCommand{\ugqLaTeX}{L\kern-.15em
  170.         {\calculate@math@sizes
  171.          \setbox0\hbox{T}%
  172.          \vbox to\ht0{\hbox{%
  173.                             \csname S@\f@size\endcsname
  174.                             \fontsize\sf@size\z@
  175.                             \math@fontsfalse\selectfont
  176.                             A}%
  177.                       \vss}%
  178.         }%
  179.         \kern-.01em
  180.         \TeX}
  181.  
  182. % The TeX logo for use with CMSS.
  183.  
  184. \def\cmssTeX{T\kern-.2em\lower.4ex\hbox{E}\kern-.05emX\@}
  185.  
  186. % The LaTeX logo for use with CMSS.
  187.  
  188. \DeclareRobustCommand{\cmssLaTeX}{L\kern-.22em
  189.         {\setbox0\hbox{T}%
  190.          \vbox to\ht0{\hbox{%
  191.                             \csname S@\f@size\endcsname
  192.                             \fontsize\sf@size\z@
  193.                             \math@fontsfalse\selectfont
  194.                             A}%
  195.                       \vss}%
  196.         }%
  197.         \kern-.17em
  198.         \TeX}
  199.  
  200. % Switch off some of the article options.
  201.  
  202. \DeclareOption{a4paper}{\OptionNotUsed}
  203. \DeclareOption{a5paper}{\OptionNotUsed}
  204. \DeclareOption{b5paper}{\OptionNotUsed}
  205. \DeclareOption{letterpaper}{\OptionNotUsed}
  206. \DeclareOption{legalpaper}{\OptionNotUsed}
  207. \DeclareOption{executivepaper}{\OptionNotUsed}
  208. \DeclareOption{landscape}{\OptionNotUsed}
  209. \DeclareOption{twoside}{\OptionNotUsed}
  210. \DeclareOption{titlepage}{\OptionNotUsed}
  211. \DeclareOption{onecolumn}{\OptionNotUsed}
  212.  
  213. % The CM fonts
  214.  
  215. \newcommand{\@titlefont}{\normalfont\Huge}
  216. \newcommand{\@indiciafont}{\normalfont\footnotesize}
  217. \newcommand{\@headingfont}{%
  218.    \large\sffamily\slshape
  219.    \let\LaTeX\cmssLaTeX\let\TeX\cmssTeX
  220. }
  221.  
  222. % The LW 35 fonts option
  223.  
  224. \DeclareOption{lw35fonts}{%
  225.    \renewcommand{\rmdefault}{ppl}%
  226.    \renewcommand{\ttdefault}{pcr}%
  227.    \renewcommand{\sfdefault}{phv}%
  228.    \renewcommand{\@titlefont}{%
  229.       \fontsize{50}{60}\fontfamily{phv}\fontseries{b}\selectfont
  230.       \let\LaTeX\phvLaTeX\let\TeX\phvTeX
  231.    }%
  232.    \renewcommand{\@indiciafont}{%
  233.       \fontsize{8}{10}\fontfamily{ppl}\fontshape{it}\selectfont
  234.    }%
  235.    \renewcommand{\@headingfont}{%
  236.       \fontsize{12}{14}\fontfamily{phv}\fontseries{b}\selectfont
  237.       \let\LaTeX\phvLaTeX\let\TeX\phvTeX
  238.    }%
  239.    \DeclareSymbolFont{letters}{OML}{ptmcm}{m}{it}%
  240.    \DeclareSymbolFont{symbols}{OMS}{pzccm}{m}{n}%
  241.    \let\LaTeX\pplLaTeX
  242.    \let\TeX\pplTeX
  243. }
  244.  
  245. % The type 1 fonts option
  246.  
  247. \DeclareOption{type1fonts}{%
  248.    \renewcommand{\rmdefault}{put}%
  249.    \renewcommand{\ttdefault}{hlct}%
  250.    \renewcommand{\sfdefault}{ugq}%
  251.    \renewcommand{\@titlefont}{%
  252.       \fontsize{50}{60}\fontfamily{ugq}\fontseries{b}\selectfont
  253.       \let\LaTeX\ugqLaTeX\let\TeX\ugqTeX
  254.    }%
  255.    \renewcommand{\@indiciafont}{%
  256.       \fontsize{8}{10}\fontfamily{put}\fontshape{it}\selectfont
  257.    }%
  258.    \renewcommand{\@headingfont}{%
  259.       \fontsize{12}{14}\fontfamily{ugq}\fontseries{b}\selectfont
  260.       \let\LaTeX\ugqLaTeX\let\TeX\ugqTeX
  261.    }%
  262.    \renewcommand{\verbatim@font}{%
  263.       \fontsize{9}{12}\fontfamily{hlct}\selectfont
  264.    }%
  265.    \DeclareSymbolFont{letters}{OML}{ptmcm}{m}{it}%
  266.    \DeclareSymbolFont{symbols}{OMS}{pzccm}{m}{n}%
  267.    \let\LaTeX\putLaTeX
  268.    \let\TeX\putTeX
  269. }
  270.  
  271. % The default action for any option is to pass it to the article
  272. % class.
  273.  
  274. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
  275.  
  276. % Execute the options.
  277.  
  278. \ProcessOptions
  279.  
  280. % Load the article class.
  281.  
  282. \LoadClass[twocolumn,oneside]{article}
  283.  
  284. % The page style.
  285.  
  286. \pagestyle{empty}
  287. \setlength{\parindent}{1em}
  288. \setlength{\rightskip}{0pt plus \textwidth}
  289. \setlength{\@rightskip}{\rightskip}
  290. \setlength{\parfillskip}{0pt plus 2\textwidth}
  291. \setlength{\columnsep}{2em}
  292.  
  293. % The text size, which tries to work with both A4 and letter paper sizes. 
  294.  
  295. \setlength{\textheight}{230mm}
  296. \setlength{\topmargin}{-10mm}
  297.  
  298. \setlength{\textwidth}{180mm}
  299. \setlength{\oddsidemargin}{-10mm}
  300.  
  301. % \maketitle parameters.
  302.  
  303. \newcommand{\publicationmonth}{\renewcommand{\@month}}
  304. \newcommand{\@month}{\ClassError{ltnews}
  305.    {No \protect\publicationmonth~given}\@eha}
  306.  
  307. \newcommand{\publicationyear}{\renewcommand{\@year}}
  308. \newcommand{\@year}{\ClassError{ltnews}
  309.    {No \protect\publicationyear~given}\@eha}
  310.  
  311. \newcommand{\publicationissue}{\renewcommand{\@issue}}
  312. \newcommand{\@issue}{\ClassError{ltnews}
  313.    {No \protect\publicationissue~given}\@eha}
  314. \newcommand{\issuename}{Issue}
  315.  
  316. \newcommand{\indicia}{\renewcommand{\@indicia}}
  317. \newcommand{\@indicia}{%
  318.    \LaTeXNews, and the \LaTeX{} software,
  319.    is brought to you by the \LaTeX3 project team;
  320.    Copyright \@year, all rights reserved.
  321. }
  322.  
  323. \title{\LaTeXNews}
  324.  
  325. % The \maketitle for the LaTeX News.
  326.  
  327. \renewcommand{\maketitle}{%
  328.    \twocolumn[{%
  329.       \parbox[t][7\baselineskip]{\textwidth}{%
  330.          \@titlefont\@title\\[\medskipamount]
  331.          \normalfont\normalsize\issuename~\@issue, \@month~\@year
  332.       }%
  333.    }]%
  334.    \thispagestyle{titlepage}
  335. }
  336.  
  337. \newcommand{\ps@titlepage}{%
  338.    \renewcommand{\@oddhead}{\hfill}%
  339.    \renewcommand{\@evenhead}{\hfill}%
  340.    \renewcommand{\@oddfoot}{\@indiciafont\@indicia\hfill}%
  341.    \renewcommand{\@evenfoot}{\@indiciafont\@indicia\hfill}%
  342. }
  343.  
  344. % Sectioning commands.
  345.  
  346. \renewcommand{\section}{%
  347.    \@startsection
  348.       {section}{1}{\z@}{-1.5ex \@plus -1ex \@minus -.2ex}%
  349.       {1ex \@plus.2ex}{\@headingfont}%
  350. }
  351.  
  352. % No section numbers.
  353.  
  354. \setcounter{secnumdepth}{0}
  355.  
  356. % Set lists tighter, but brought in by 1em (otherwise the first line 
  357. % always looks very wide).
  358.  
  359. \renewcommand{\@listI}{%
  360.    \setlength{\parsep}{0pt}%
  361.    \setlength{\topsep}{\medskipamount}%
  362.    \setlength{\itemsep}{0pt}%
  363.    \setlength{\listparindent}{1em}%
  364.    \setlength{\rightskip}{1em}%
  365. }
  366.  
  367. \newenvironment{citations}{%
  368.    \list{}{%
  369.       \renewcommand{\makelabel}[1]{\itshape{##1},}%
  370.    }%
  371. }{%
  372.    \endlist
  373. }
  374.  
  375. % Some logos.
  376.  
  377. \newcommand{\NFSS}{NFSS}
  378. \newcommand{\LaTeXNews}{\LaTeX~News}
  379. \newcommand{\AW}{Addison Wesley}
  380. \newcommand{\SLiTeX}{\textsc{Sli}\TeX}
  381. \newcommand{\AmS}{$${\protect\the\textfont2 A}\kern-.1667em\lower
  382.          .5ex\hbox{\protect\the\textfont2 M}\kern
  383.          -.125em{\protect\the\textfont2 S}}
  384. \newcommand{\AmSLaTeX}{\mbox{\AmS-\LaTeX}}
  385.  
  386. % Hacking to make <...> produce italics in verbatim.  NB: this can be 
  387. % done more cleanly using the verbatim package.  But the ltnews class has 
  388. % to run on any LaTeX installation, even those without the verbatim 
  389. % package.  
  390.  
  391. % Here we extend the font-setting command to include making <> active
  392. % (ie adjusting the input encoding).
  393. \renewcommand \verbatim@font {%
  394.   \normalfont \ttfamily
  395.   \catcode`\<=\active
  396.   \catcode`\>=\active
  397. }
  398.   
  399. % Make active <...> produce italics surrounded by angle brackets (used in
  400. % verbatim and \verb).
  401. % << produces a less-than, and >> produces a greater-than.
  402.  
  403. \begingroup
  404.   \catcode`\<=\active
  405.   \catcode`\>=\active
  406.   \gdef<{\@ifnextchar<\@lt\@meta}
  407.   \gdef>{\@ifnextchar>\@gt\@gtr@err}
  408.   \gdef\@meta#1>{{\reset@font\normalsize\itshape#1\/}}
  409.   \gdef\@lt<{\char`\<}
  410.   \gdef\@gt>{\char`\>}
  411. \endgroup
  412. \def\@gtr@err{%
  413.    \ClassError{ltxguide}{%
  414.       Isolated \protect>%
  415.    }{%
  416.       In this document class, \protect<...\protect>
  417.       is used to indicate a parameter.\MessageBreak
  418.       I've just found a \protect> on its own.
  419.       Perhaps you meant to type \protect>\protect>?
  420.    }%
  421. }
  422. \def\verbatim@nolig@list{\do\`\do\,\do\'\do\-}
  423.  
  424. % That's it!
  425.  
  426. \endinput
  427.  
  428. % CHANGELOG
  429. %
  430. % 20 May 1994, v0.01: Created file.
  431. %
  432. % 21 May 1994, v0.02: Made <...> produce italics inside verbatim.  Added 
  433. %    the indicia, \publicationyear, \publicationmonth and 
  434. %    \publicationissue.  Added the citations environment.  Switched off 
  435. %    some of the article class options.
  436. % 21 May 1994, v0.03: Fixed a bug with ragged right.  Fixed a bug
  437. %    which was causing underfull hbox messages.
  438. % 27 May 1994, v0.04: Added SliTeX logo, and proper AMS LaTeX logo.
  439. %    Added angle brackets to <...>.
  440. %
  441. % 31 May 1994, v0.05: Added downloaded PS fonts options.  Removed
  442. %    angle brackets from <...> since these were the last remaining
  443. %    bitmaps!  Added variants of the LaTeX logo.  Added the ltnews.cfg
  444. %    file.  Added the lw35fonts option.
  445. %
  446. % 27 Jul 1994, v0.06: Corrected a typo `\PassOptionToClass' should
  447. %    have been `\PassOptionsToClass'.  Manas Mandal pointed that one
  448. %    out. 
  449. %
  450. % 29 Nov 1994, v0.07: Made <...> only active in verbatim.
  451.  
  452. % BUGS
  453. %
  454. % Switching between logos like this is a mess.
  455. %
  456. % The last column should be set flush bottom.
  457.  
  458.